<%@ page contentType="text/html;charset=ISO8859_1" language="java" %>

<%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/tld/struts-nested.tld" prefix="nested" %>

<jsp:useBean id="oNavigate" class="git.bankview.wl.bean.TransNavigateBean" />
<jsp:setProperty name="oNavigate" property="transid" value="97990"/>

<html:html locale="true">
<head>
	<title><logic:iterate id="element" name="oNavigate" property="navigateList"
	><bean:write name="element" property="translabel" />
	 - </logic:iterate></title>
	<!-- title><bean:message key="report.UploadTable.title" /></title -->
	<link rel="stylesheet" href="../style/default_aux.css">
</head>
<body onload="oninit();">
	<script src="../script/overlib.js" language="JavaScript"></script>
	<script src="../script/style.js" language="JavaScript"></script>
	<script src="../script/windows.js" language="JavaScript"></script>
	<table cellspacing="0" class="filledframe">
		<tr>
			<td nowrap="" class="clientframe">
				<table id="oHelp" class="helper" >
					<tr>
						<td width="200" class="label">&nbsp;</td>
						<td class="help"><input type="button" class="button" title="<bean:message key="common.help.title" />" onclick="help('help.report.schd');" value="<bean:message key="common.help" />" ></td>
					</tr>
				</table>
				<form action="<html:rewrite action="/report/UploadTable" />" enctype="multipart/form-data" method="post" target="upload" id="oUploadForm" onsubmit="return onSubmitCheck(this)">
					<div class="listtitle"><logic:iterate id="element" name="oNavigate" property="navigateList"
						><logic:empty name="element" property="pageurl"><bean:write name="element" property="translabel" /><img src="/images/navconn.gif" ></logic:empty
						><logic:notEmpty name="element" property="pageurl"><a href="<bean:write name="element" property="pageurl" />" title="<bean:write name="element" property="transid" />"><bean:write name="element" property="translabel" /></a></logic:notEmpty
						></logic:iterate></div>
					<!-- div class="listtitle"><bean:message key="report.UploadTable.title" /></div -->
					<div class="subtitle"><bean:message key="report.UploadTable.desc" /><br><html:errors /></div>
					<table width="500" cellspacing="0" class="formpanel">
						<tr><td class="toppad">&nbsp;</td></tr>
						<tr><td class="input"><table cellspacing="1"><tr>
							<td nowrap class="label"><bean:message key="report.UploadTable.dsName" /></td>
							<td nowrap ><input type="text" class="text" name="dsName" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="return onFieldBlur()" value="GenericDS" ></td>
						</tr></table></td></tr>
						<tr><td class="input"><table cellspacing="1"><tr>
							<td nowrap class="label"><bean:message key="report.UploadTable.tableName" /></td>
							<td nowrap ><input type="text" class="text" name="tableName" onkeydown="return focusMove()" onfocus="onFieldFocus()" onblur="return onFieldBlur()" ></td>
						</tr></table></td></tr>
						<tr><td class="input"><table cellspacing="1"><tr>
							<td nowrap class="label"><bean:message key="report.UploadTable.title" /></td>
							<td nowrap ><input type="file" class="text" name="uploadFile" onfocus="onFieldFocus()" onblur="return onFieldBlur()" ></td>
						</tr></table></td></tr>
						<tr><td class="input"><table cellspacing="1"><tr>
							<td nowrap class="label"><bean:message key="load.policyLabel" /></td>
							<!-- td nowrap ><input type="radio" name="importPolicy" value="APPEND" checked title="<bean:message key="load.policy.appendDesc" />" ><bean:message key="load.policy.append" />
								<input type="radio" name="importPolicy" value="UNION" title="<bean:message key="load.policy.unionDesc" />" ><bean:message key="load.policy.union" />
								<input type="radio" name="importPolicy" value="UPDATEONLY" title="<bean:message key="load.policy.updateOnlyDesc" />" ><bean:message key="load.policy.updateOnly" />
								<input type="radio" name="importPolicy" value="EMPTYSCHDFIRST" title="<bean:message key="load.policy.emptySchdFirstDesc" />" ><bean:message key="load.policy.emptySchdFirst" />
								<input type="radio" name="importPolicy" value="EMPTYTABFIRST" title="<bean:message key="load.policy.emptyTableFirstDesc" />" ><bean:message key="load.policy.emptyTableFirst" />
							</td -->
							<td nowrap >
								<select name="importPolicy" onchange="onLoadPolicyChange(this)" >
									<option value="APPEND" selected ><bean:message key="load.policy.append" /></option>
									<option value="UNION"><bean:message key="load.policy.union" /></option>
									<option value="UPDATEONLY"><bean:message key="load.policy.updateOnly" /></option>
									<option value="EMPTYSCHDFIRST"><bean:message key="load.policy.emptySchdFirst" /></option>
									<option value="EMPTYTABFIRST"><bean:message key="load.policy.emptyTableFirst" /></option>
								</select><br>
							</td>
							<td nowrap id="oLoadPolicyDesc" style="padding-left: 15px; "><bean:message key="load.policy.appendDesc" /></td>
						</tr></table></td></tr>
						<tr><td class="line">
							<div class="progress" id="oUploadProgress" ></div></td></tr>
						<tr><td class="bottompad">&nbsp;</td></tr>
					</table>
					<table width="500" class="formpanelbar">
						<tr>
							<td align="right" nowrap="">
								<html:submit tabindex="1001" styleClass="button" styleId="oSubmit"><bean:message key="common.submit" /></html:submit></td>
						</tr>
					</table>
				</form>
			</td>
			<!-- td id="oFrame" nowrap="" class="infoframe">&nbsp;</td -->
		</tr>
	</table>
	
<script language="javascript">
function oninit()
{
}

function onSubmitCheck(f)
{
	if (0 == f.dsName.value.length)
	{
		alert("<bean:message key="report.UploadTable.dsName" /><bean:message key="common.need" />");
		return false;
	}
	else if (0 == f.tableName.value.length)
	{
		alert("<bean:message key="report.UploadTable.tableName" /><bean:message key="common.need" />");
		return false;
	}
	else if (0 == f.uploadFile.value.length)
	{
		alert("<bean:message key="common.uploading" arg0=".csv" />");
		return false;
	}
	
	f.oSubmit.disabled = true;
	oUploadProgress.innerText = "<bean:message key="common.uploading" />: '" + f.uploadFile.value + "', <bean:message key="common.wait" />";
	return true;
}
function onUploadFinished(totalBytes, totalRows)
{
	oUploadProgress.innerText = "<bean:message key="common.uploadOk" />; <bean:message key="common.fileSize" />: " + totalBytes + " <bean:message key="common.bytes" />; <bean:message key="report.UploadTable.uploadRows" />: " + totalRows;
	oUploadForm.oSubmit.disabled = false;
}
function onFault(msg)
{
	oUploadProgress.innerHTML = "<span style='color: #ff0000; '>" + msg + "</span>"
	oUploadForm.oSubmit.disabled = false;
}
function onLoadPolicyChange(c)
{
	if ("APPEND" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.appendDesc" />";
	else if ("UNION" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.unionDesc" />";
	else if ("UPDATEONLY" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.updateOnlyDesc" />";
	else if ("EMPTYSCHDFIRST" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.emptySchdFirstDesc" />";
	else if ("EMPTYTABFIRST" == c.value)
		oLoadPolicyDesc.innerText = "<bean:message key="load.policy.emptyTableFirstDesc" />";
	else
		oLoadPolicyDesc.innerText = " ";
}
</script>

	<iframe id="oUploadFrame" name="upload" style="display: none; "></iframe>
</body>
</html:html>




